/*
 * Author: vyouzhi <vyouzhi@163.com>
 * http://www.xda.cn
 *
 * File: t_stats.c
 * Create Date: 2012-02-13 16:22:40
 *
 */
#include <error.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>

#include "conf_lib.h"
#include "status_lib.h"

int main(int argc, char* argv[]){
	int h;
	char *c, *res;

	if(argc < 2){
		printf("%s --help\n", argv[0]);
		exit(-1);
	}
	while((h = getopt(argc, argv, "c:d")) != -1){
		switch(h){
			case 'c':
				c = optarg;
				break;
			case 'd':
				break;
			default:
				printf("%s --help\n", argv[0]);
				exit(-1);
		}
	}

	conf_init(c);

    pool_init();

    Get_FieldName();
    status_init_all();

    sta_add_base_link("SELECT * FROM `action`", 3);
    sta_add_base_link("SELECT * FROM `dede`.`dede_addonshop`", 2);
    sta_add_base_link("SELECT * FROM `action`", 5);
    sta_add_base_link("SELECT * FROM `dz`.`pre_common_admincp_perm` where cpgroupid=2", 2);
    sta_add_base_link("SELECT * FROM `xdax15`.`xda_x1_forum_post` where fid = 2 order by pid desc limit 10",6);
    sta_add_base_link("SELECT * FROM `android`.`software` where cid=87 and id>8 limit 3",9);
    sta_add_base_link("SELECT * FROM `redmine`.`enabled_modules` where id=9 and project_id=1", 5);
    sta_add_base_link("SELECT * FROM `ecs_article`", 2);

    res = sta_get_link();
    printf("res %s\n", res);
    free(res);
    object_free_all(status_object_head);
    FieldName_free(status_fn_head);
    return 0;
}
/* vim: set ts=4 sw=4: */

